package 简单的工厂模式.工厂模式demo.商场促销;

/**
 * @author zyl
 * @Description
 * @since 2023/12/26 11:03
 */

public class CashSuperFactory {

    public static CashSuper creatCashSuper(int cashType){
        CashSuper cashSuper = null;
        switch (cashType){
            case 1:
                cashSuper = new CashNormal();
                break;
            case 2:
                cashSuper = new CashRebate(0.8d);
                break;
            case 3:
                cashSuper = new CashRebate(0.7d);
                break;
            case 4:
                cashSuper = new CashReturn(300d,100d);
                break;
        }
        return cashSuper;
    }
}
